package net.huashitong.oversee.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.oversee.dao.InspectorsDao;
import net.huashitong.oversee.entity.Inspectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InspectorsService extends StringPKService<Inspectors> {
    @Override
    protected BaseDao<Inspectors, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(Inspectors obj) {
        obj.setSysId(tableService.updateMaxSysId("t_bnp_inspectors", null));
    }

    @Autowired
    private SysTableService tableService;

    @Autowired
    private InspectorsDao dao;


    /**
     * 根据督查组类别查询督查人员
     * @param groupTypeId
     * @return
     */
    public List<Inspectors> queryByGroupTypeId(String groupTypeId){
        return dao.queryByGroupTypeId(groupTypeId);
    }


}
